<%@ page contentType="text/html" language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib  uri="/struts-tags" prefix="s"%>
<h2 class="contentTitle">添加新项目</h2>
<div class="pageContent">
<s:if test="%{tab == 'editMsg'}">
    <form method="post" action="projectmanagement/projectmanagementUpdateDetail" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone)">
</s:if>
<s:else>
    <form method="post" action="projectmanagement/ProjectmanagementUpdate" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone)">
</s:else>
    <!-- 隐藏域开始 -->
    <input type="hidden" name="b_T_Flow_ProjectManagement.projectUuid" value="${b_T_Flow_ProjectManagement.projectUuid}" />
    <input type="hidden" name="flag" value="${flag}"/>
    <!-- 隐藏域结束 -->
    	<div class="pageFormContent" layoutH="97">
			<p>
				<label>项目名称：</label>
                <input type="text"  size="29" name="b_T_Flow_ProjectManagement.projectName" value="${b_T_Flow_ProjectManagement.projectName}" class="required"/><span class="info">必填</span>
			</p>
				<p>
				<label>项目代码：</label>
				 <input type="text" size="29" name="b_T_Flow_ProjectManagement.projectCode" value="${b_T_Flow_ProjectManagement.projectCode}"class="required" /><span class="info">必填</span>
			</p>
			<p>
				<label>负&nbsp;&nbsp;责&nbsp;&nbsp;人：</label>
			    <input type="text"  size="29" name="b_T_Flow_ProjectManagement.staffName" readOnly="true" value="${b_T_Flow_ProjectManagement.staffName}" class="required" lookupGroup="b_T_Flow_ProjectManagement.staffName"/><span class="info">必填</span>
				<a class="btnLook" href="investment/StaffCallback?lookup=1" lookupGroup="b_T_Flow_ProjectManagement">查找带回</a>	
			</p>
			<p>
				<label>项目状态：</label>
				<input type="hidden" size="29" name="b_T_Flow_ProjectManagement.statusId" value="${b_T_Flow_ProjectManagement.statusId}" lookupGroup="b_T_Flow_ProjectManagement.statusId"/>
			    <input type="text" size="29" name="b_T_Flow_ProjectManagement.projectStatus" value="${b_T_Flow_ProjectManagement.projectStatus}" class="required" lookupGroup="b_T_Flow_ProjectManagement.projectStatus"/><span class="info">必填</span>
			    <a class="btnLook" href="projectmanagement/StatusListCallBack?lookup=1" lookupGroup="b_T_Flow_ProjectManagement">查找带回</a>	
			</p>
			<p>
				<label>客户信息：</label>
				<input type="hidden" size="29" id="customerId" name="b_T_Flow_ProjectManagement.customerId" value="${b_T_Flow_ProjectManagement.customerId}"/>
			    <input type="text" size="29" id="customerInformation" name="b_T_Flow_ProjectManagement.customerInformation" value="${b_T_Flow_ProjectManagement.customerInformation}" class="required"/><span class="info">必填</span>
				 <a class="btnLook" href="costomer/ContractCallback?lookup=1" lookupGroup="b_T_Flow_ProjectManagement">查找带回</a>	
			</p>
			<p>
				<label>项目开始时间：</label>
			    <input type="text"  name="b_T_Flow_ProjectManagement.beginTime" value="${b_T_Flow_ProjectManagement.beginTime}" class="date" size="26" /><a class="inputDateButton" href="javascript:;">选择</a>

			</p>
			<p>
				<label>项目结束时间：</label>
			    <input type="text"  name="b_T_Flow_ProjectManagement.endTime" value="${b_T_Flow_ProjectManagement.endTime}" class="date" size="26" /><a class="inputDateButton" href="javascript:;">选择</a>

			</p>
			<p>
				<label>项目关闭时间：</label>
			    <input type="text"  name="b_T_Flow_ProjectManagement.closeTime" value="${b_T_Flow_ProjectManagement.closeTime}" readOnly="true" size="26" /><a class="inputDateButton" href="javascript:;">选择</a>

			</p>
			<dl class="nowrap" id="relx">
					<dt>附件：</dt>
						<dd>
						<a class="btnAttach" href="projectmanagement/fileTypeLists?moduleName=project&projectUuid=${b_T_Flow_ProjectManagement.projectUuid}" target="dialog" width="600" height="500" title="上传附件" ></a>
						<span id="result"></span>
							<c:forEach items="${pagerFile.pageRecords}" var="c_T_Sys_File" varStatus="s">
								<tr target="sid_obj" rel="relx">
									<td>${s.count +pagerFile.pageSize*(pagerFile.currentPage-1)}.</td>
									<!--  <td><a href="projectmanagement/download?fileName=${c_T_Sys_File.fileName}" title="文件另存为"><font color="blue">${c_T_Sys_File.fileName}</font></a></td>-->
									<td><a href="${c_T_Sys_File.fileUflPath}" title="文件另存为"><font color="blue">${c_T_Sys_File.fileTime}-->${c_T_Sys_File.createUser}-->${c_T_Sys_File.fileName}</font></a></td>
									<td><a href="javascript:void(0);" onClick="return del('${c_T_Sys_File.fileName}','${c_T_Sys_File.fileId}','');"  title="确定要删除吗?"><img src="dwz/uploadify/cancel.png" border="0"></a><br /></td>
								</tr>
							</c:forEach>
					</dd>
			</dl>
			<div class="unit">
			<p>
				<label>项目描述：</label>
			</p>
				<textarea name="b_T_Flow_ProjectManagement.projectDescription" cols="110" rows="10" class="editor" upImgUrl="costomer/Update" upImgExt="jpg,jpeg,gif,png" >${b_T_Flow_ProjectManagement.projectDescription}</textarea>
			</div>
			<div class="unit">
			<p>
				<label>备&nbsp;&nbsp;&nbsp;&nbsp;注：</label>
			</p>
				<textarea name="b_T_Flow_ProjectManagement.remark" cols="110" rows="10" class="editor" upImgUrl="costomer/Update" upImgExt="jpg,jpeg,gif,png" >${b_T_Flow_ProjectManagement.remark}</textarea>
			</div>
	</div>
			
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit" id="submit1">
                              保存
                            </button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">
                                取消
                            </button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
<script type="text/javascript">
	function del(fileName,id,unm){
		jQuery.ajax( {
			async : false,
            cache : false,
            type : 'POST',
            dataType : "json",
            url : 'projectmanagement/fileDelete?checkIds='+id,
            error : function() {//请求失败处理函数  
                    alert('请求失败');
                },
                success : function(data) { //请求成功后处理函数。
                	//dump_obj(data);
                if(unm != ""){
                	$("#"+unm).remove();
                }else{
                	 var projectUuid = '${b_T_Flow_ProjectManagement.projectUuid}';
                     $("#relx").load("projectmanagement/ProjectmanagementJump?b_T_Flow_ProjectManagement.projectUuid="+projectUuid+" #relx>*");
                }
			}
        });
	}
	//打印json数据
	function dump_obj(myObject) {
		  var s = "";
		  for (var property in myObject) {
		   s = s + "\n "+property +": " + myObject[property] ;
		  }
		  alert(s);
		}
</script> 